<template>
	<view class="content">

		<view class="topHead">
			<view class="top">
				<!-- <u-avatar :src="src" size="60"></u-avatar> -->
				<image src="../../static/img/avauter.png" style="width:160rpx;height: 160rpx;"></image>
				<view style="line-height: 60rpx;">
					<view class="c_cell">
						<view class="name" @click="setting">{{title}}</view>
						<!-- <view class="name2" @click="setting">普通会员</view> -->
					</view>
					<view class="c_cell">
						<span>{{customerName}}</span>
						<!-- <span>积分: 0</span>
						<span>电子保修卡: 0</span> -->
					</view>
				</view>
			</view>
		</view>

		<uni-card>
			<template v-slot:title>
				<view class="c_head">
					<span>订单状态</span>
					<view style="display: flex;">
						<!-- <view class="c_head_right" style="display: flex;">
							<u-icon name="scan" color="#2979ff" size="21"></u-icon>
							<span>扫码添加家电</span>
						</view>
						<span class="c_head_right" style="font-size: 30rpx;margin: 0 15rpx;">|</span> -->
						<view class="c_head_right" style="display: flex;">
							<u-icon name="grid" color="#2979ff" size="18"></u-icon>
							<!-- <span>全部订单</span> -->
						</view>
					</view>
				</view>
			</template>
			<view class="c_row" style="margin-top: 20rpx;">
				<view class="c_cell" @click="queryList1(0)">
					<image :mode="item.mode" src="../../static/icon/3_1.png" @error="imageError"></image>
					<span>已报修</span>
				</view>
				<!-- <view class="c_cell" @click="queryList1(1)">
					<image :mode="item.mode" src="../../static/icon/2_2.png" @error="imageError"></image>
					<span>维修完成</span>
				</view> -->
				<view class="c_cell" @click="queryList1(1)">
					<image :mode="item.mode" src="../../static/icon/3_2.png" @error="imageError"></image>
					<span>维修完成</span>
				</view>
				<view class="c_cell" @click="queryList1(2)">
					<image :mode="item.mode" src="../../static/icon/3_3.png" @error="imageError"></image>
					<span>已评价</span>
				</view>
			</view>
		</uni-card>

		<uni-card>
			<u-cell-group>
				<u-cell title="服务进度" :border="false" icon="clock" isLink @click="toOrder"></u-cell>
				<u-cell title="个人中心" :border="false" icon="email" isLink @click="setting"></u-cell>
			</u-cell-group>
		</uni-card>
	</view>
</template>

<script>
	import {useRouter} from '@/utils/utils.js';
	export default {
		data() {
			return {
				src: "https://pic.nximg.cn/file/20230519/34708118_135431304107_2.jpg",
				text: "无",
				title:'游客登录',
				customerName:''
			}
		},
		onShow() {
			this.title = uni.getStorageSync('username')
			this.customerName=getApp().globalData.customerName
		},
		methods: {
			toOrder() {
				uni.navigateTo({
					url: '/pagesIndex/order/order?index=0'
				})
			},
			queryList1(index){
				uni.navigateTo({
					url:'/pagesIndex/order/order?index='+index
					// url:'/pagesIndex/evaluate/eavlsuccess'
				})
			},
			setting() {
				useRouter('/pages/my/account/index', {}, 'navigateTo');
			},
		}
	}
</script>

<style>
	page {
		margin: 0;
		padding: 0;
		height: calc(100% - 15px);
		width: 100%;
		background: #f3f7fd;
	}

	// 去掉页面滚动条
	::-webkit-scrollbar {
		display: none !important;
		width: 0 !important;
		height: 0 !important;
		-webkit-appearance: none;
		background: transparent;
	}
</style>
<style lang="scss" scoped>
	::v-deep .u-line {
		display: none;
	}

	::v-deep .uni-card {
		background: linear-gradient(#ecf6ff, #fff);
	}

	.content {
		padding-bottom: 20rpx;
	}

	.c_head {
		display: flex;
		justify-content: space-between;
		margin: 20rpx 20rpx 0 20rpx;

		.c_head_right {
			color: #888;
			font-size: 26rpx;
		}
	}

	.c_row {
		display: flex;
		justify-content: space-around;

		.c_cell {
			width: 22%;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			background: #fff;
			padding: 30rpx 0 10rpx 0;
			border-radius: 20rpx;

			span {
				margin: 20rpx 0;
			}

			image {
				width: 70rpx;
				height: 70rpx;
			}
		}
	}

	.topHead {
		margin: 0;
		background: linear-gradient(#1989ff, #c1dfff);
		// border-radius: 0 0 60rpx 60rpx;
		padding: 50rpx 30rpx;

		.top {
			display: flex;
		}

		.c_cell {
			display: flex;
			margin: 10rpx 20rpx;

			.name {
				color: #fff;
				font-size: 38rpx;
			}

			.name2 {
				color: #0741ff;
				margin-left: 20rpx;
				margin-top: 10rpx;
				font-size: 26rpx;
				background: #e6fbff;
				padding: 0 10rpx;
				border-radius: 10rpx;
			}

			span {
				color: #fff;
				font-size: 28rpx;
				margin-right: 20rpx;
			}
		}
	}

	.card-actions {
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		align-items: center;
		height: 45px;
		border-top: 1px #eee solid;
	}

	.card-actions-item {
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.card-actions-item-text {
		font-size: 12px;
		color: #666;
		margin-left: 5px;
	}
</style>